'use strict';

angular.module('tvshowsApp')
    .controller('ShowHistoryDetailController', function ($scope, $stateParams, ShowHisto, Show) {

        $scope.histo = [];

        $scope.loadAll = function (id) {
            ShowHisto.query({id: id},function (result) {
                $scope.histo = result;
            });
        };

        $scope.show = [];
        $scope.load = function (id) {
            console.log("passe dans load " + id);
            Show.get({id: id}, function(result) {
                $scope.show = result;
            });
        };

        $scope.loadAll($stateParams.id);
        $scope.load($stateParams.id);

    });
